import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { IsNotEmpty } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
@Entity()
export class Position {
  @PrimaryGeneratedColumn()
  id: string;

  @Column({ comment: '' })
  contract: string;

  @Column({ comment: '' })
  leverage: string;

  @Column({ comment: '' })
  text: string;

  @Column({ comment: '' })
  long_price: string;

  @Column({ comment: '' })
  pnl: string;

  @Column({ comment: '' })
  pnl_pnl: string;

  @Column({ comment: '' })
  pnl_fee: string;

  @Column({ comment: '' })
  pnl_fund: string;

  @Column({ comment: '' })
  accum_size: string;

  @Column({ comment: '' })
  time: number;

  @Column({ comment: '' })
  short_price: string;

  @Column({ comment: '' })
  side: string;

  @Column({ comment: '' })
  max_size: string;

  @Column({ comment: '' })
  first_open_time: number;

  // 自定义
  @Column({ comment: '' })
  userId: number;

  @Column({ comment: '' })
  userName: string;

  @Column({ comment: '' })
  userDirection: number;

  @Column({ comment: '' })
  userZhiMaKey: string;

  @Column({ comment: '' })
  price: string;

  @Column({ comment: '' })
  contractInfo: string;

  @Column({ comment: '' })
  leverInfo: string;

  @Column({ comment: '' })
  ysxYingKui: string;

  @Column({ comment: '' })
  pingCangTime: string;

  @CreateDateColumn({
    type: 'timestamp',
    nullable: false,
    name: 'create_time',
    comment: '创建时间',
  })
  create_time: Date;

  @UpdateDateColumn({
    type: 'timestamp',
    nullable: false,
    name: 'update_time',
    comment: '更新时间',
  })
  update_time: string;
}
